#pragma once

#include "LionRadianDegree.h"
#include "Components/LionRenderWindowComponent.h"

class CameraProxy
{
public:
    enum E_MOVE_DIR
    {
        MOVE_NONE = 0,
        MOVE_FORWARD = 1,
        MOVE_BACK = 1 << 1,
        MOVE_LIFT = 1 << 2,
        MOVE_RIGHT = 1 << 3
    };

protected:
    Lion::RenderWindowComponent*	m_pCamera;
    Lion::u16 m_eMoveDir;
    Lion::f32 m_moveSpeed;

    bool m_isCameraRotation;
    Lion::Radian m_pitch;
    Lion::Radian m_yaw;

public:
    CameraProxy();

    void setCamera(Lion::RenderWindowComponent* pCamera);

    void setPosition(const Lion::Vec3& pos);
    void setDirection(const Lion::Vector3F32 &dir, const Lion::Vector3F32 &up);
    void setAspect(Lion::f32 aspect);

    void update(Lion::f32 deltaTime);

    void moveBegin(E_MOVE_DIR dir);
    void moveEnd(E_MOVE_DIR dir);

    void rotateBegin();
    void rotateEnd();

    void rotate(const Lion::Radian& pitch, const Lion::Radian& yaw);

protected:
    void _rotate();
};